﻿@page
@{ Layout = "_Layout"; }

<div style="padding:0 11px;">
    <el-form v-on:submit.native.prevent :inline="true" :model="formInline" :size="euiSize">
        <el-form-item label="用户">
            <el-input prefix-icon="el-icon-search" clearable v-model="formInline.keyword" placeholder="关键字"></el-input>
        </el-form-item>
        <el-form-item label="上次登录">
            <el-select v-model="formInline.lastActivityDate" placeholder="上次登录">
                <el-option label="<全部时间>" :value="0"></el-option>
                <el-option label="1天内" :value="1"></el-option>
                <el-option label="2天内" :value="2"></el-option>
                <el-option label="3天内" :value="3"></el-option>
                <el-option label="1周内" :value="7"></el-option>
                <el-option label="1个月内" :value="30"></el-option>
                <el-option label="3个月内" :value="90"></el-option>
                <el-option label="半年内" :value="180"></el-option>
                <el-option label="1年内" :value="365"></el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="排序">
            <el-select v-model="formInline.order" placeholder="排序">
                <el-option label="<默认>" value=""></el-option>
                <el-option label="登录名称" value="UserName"></el-option>
                <el-option label="上次登录日期" value="LastActivityDate"></el-option>
                <el-option label="创建日期" value="CreatedDate"></el-option>
                <el-option label="登录次数" value="CountOfLogin"></el-option>
            </el-select>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" v-on:click="btnSearchClick" icon="el-icon-search">查 询</el-button>
        </el-form-item>
    </el-form>

    <el-table :data="items" :size="euiSize"
              style="width: 100%">
        <el-table-column label="#"
                         type="index"
                         width="60"
                         align="left">
            <template scope="scope">
                <span>{{(formInline.currentPage - 1) * formInline.limit + scope.$index + 1}}</span>
            </template>
        </el-table-column>
        <el-table-column label="账号" show-overflow-tooltip>
            <template slot-scope="scope">
                <el-link :underline="false" type="primary" v-on:click="utils.openUserView(scope.row.id)">{{scope.row.userName}}</el-link>
            </template>
        </el-table-column>
        <el-table-column prop="displayName" show-overflow-tooltip
                         label="姓名">
        </el-table-column>
        <el-table-column prop="dutyName" show-overflow-tooltip
                         label="岗位">
        </el-table-column>
        <el-table-column prop="organNames" show-overflow-tooltip
                         label="组织">
        </el-table-column>
        <el-table-column prop="countOfLogin" width="100"
                         label="登录次数">
        </el-table-column>
        <el-table-column label="状态" width="80" align="right">
            <template slot-scope="scope">
                <el-tag type="danger" size="mini" v-if="scope.row.locked">禁用</el-tag>
                <el-tag type="success" size="mini" v-else>启用</el-tag>
            </template>
        </el-table-column>
        @await Html.PartialAsync("_PartialTableEmpty")
    </el-table>

    <div style="text-align: center; margin-top: 10px;">
        <el-pagination v-on:current-change="handleCurrentChange" background
                       :current-page="formInline.currentPage"
                       :page-size="formInline.limit"
                       layout="total, prev, pager, next, jumper"
                       :total="count">
        </el-pagination>
    </div>
</div>


@section Scripts{
    <script src="/sitefiles/assets/js/admin/settings/usersGroupUserList.js" type="text/javascript"></script>
}